<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Notifications\Notifiable;
use Watson\Validating\ValidatingTrait;

class Classes extends Model
{
    use  Notifiable;
    use ValidatingTrait;
    use SoftDeletes;
    protected $table = 'classes';
    //
    protected $fillable = [
      'id', 'c_name', 'type'
    ];
    protected $rules = [
        'c_name' => 'required|max:20|unique:classes',
        'type' => 'required'
    ];


    protected $validationMessages = [
        'c_name.required' => '班级名称必填',
        'c_name.max' => '班级名称名长度不得超过20个字符',
        'c_name.unique' => '该班级名称已经被注册过了'
    ];
}
